<template>
  <div class="app-container">

    <Tabs :active-value="queryParams.businessType" :tabs="tabs" @change="changeTab"></Tabs>

<!--    <SearchContent :queryParams="queryParams" @query="handleQuery" @reset="resetQuery">-->
<!--      <el-col :span="6">-->
<!--        <el-form-item label="付款项目:" prop="customerType">-->
<!--          <el-select v-model="queryParams.bankTypeName" clearable>-->
<!--            <el-option  label="项目1" :value="1"></el-option>-->
<!--            <el-option  label="项目2" :value="2"></el-option>-->
<!--            <el-option  label="项目3" :value="3"></el-option>-->
<!--          </el-select>-->
<!--        </el-form-item>-->
<!--      </el-col>-->
<!--    </SearchContent>-->

    <div>
      <BusinesssubcategoryList v-show="queryParams.businessType==1" ref="businesssubcategoryList"></BusinesssubcategoryList>
      <PaymentProjectList v-show="queryParams.businessType==2" ref="paymentProjectList"></PaymentProjectList>
    </div>

  </div>
</template>

<script>
import SearchContent from "@/components/SearchContent/index.vue";
import Tabs from "@/components/Tabs/index.vue"
import BusinesssubcategoryList from "@/views/system/oaInfo/components/businessSubcategory/BusinesssubcategoryList.vue";
import PaymentProjectList from "@/views/system/oaInfo/components/paymentProject/PaymentProjectList.vue";

export default {
  name: "OAList",
  components: {
    PaymentProjectList,
    BusinesssubcategoryList,
    SearchContent,
    Tabs
  },
  data() {
    return {

      tabs: [
        {
          label: '业务子类',
          value: 1,
        },
        {
          label: '付款项目',
          value: 2,
        },
      ],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        bankTypeName:null,
        businessType:1,
      },

    };
  },
  mounted() {

  },
  activated() {
    this.handleQuery()
  },
  methods: {
    changeTab(value) {
      this.queryParams.businessType = value;
      this.handleQuery();
    },

    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;

    },
    /** 重置按钮操作 */
    resetQuery() {
      this.$nextTick(()=>{
        this.$refs?.queryForm?.resetFields();
        this.handleQuery();
      })
    }

  }
};
</script>
